<?php
namespace Mp\Service\Widget;

use Mp\Service\Common\Asset;

class Textarea extends Input{

	protected $label = 'textarea';

	protected $rows = 5;

	protected $cols = 20;

	protected $js = [
		'static/mp/assets/plugins/bootstrap-maxlength/src/bootstrap-maxlength.js',
	];

	protected $script = <<<SCRIPT
	$('textarea.max-textarea').maxlength({
        alwaysShow: true
    });
SCRIPT;

	protected $view = 'Mp::widgets.textarea';

	protected function _init($params){
		Asset::js($this->js);
		Asset::script($this->script);
		$this->data = [
			'rows' =>$this->rows,
			'cols' => $this->cols,
			'name' => $this->name,
			'value' => $this->value,
		];
	}

	
}